﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace TaskProgramming
{
    class _007_Parallel
    {
        public static void Test()
        {
            Console.WriteLine("Parallel.For");
            Parallel.For(1, 4, Console.WriteLine);

            Console.WriteLine("Parallel.ForEach");
            Parallel.ForEach(new int[] { 1, 2, 3 }, Console.WriteLine);

            Console.WriteLine("Parallel.Invoke");
            Parallel.Invoke(
                () => { Console.WriteLine(1); },
                () => { Console.WriteLine(2); },
                () => { Console.WriteLine(3); }
            );

            Parallel.For(
        }
    }
}
